package com.chatsimple.netty

const val CODE_SUCCESS = 1
const val CODE_ERROR_PARSE_FAILED = 101
const val CODE_PARAM_ERROR = 102
const val CODE_HANDLE_ERROR = 103

private val ErrorMsgMap = mapOf(
    CODE_SUCCESS to "操作成功",
    CODE_ERROR_PARSE_FAILED to "解析错误",
    CODE_PARAM_ERROR to "参数错误",
    CODE_HANDLE_ERROR to "操作失败"
)

fun findMsg(code: Int): String = ErrorMsgMap[code] ?: "操作失败"